.modern-message-center {
  background: #f8f9fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  // 头部样式
  .message-header {
    background: white;
    padding: 24px 32px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

    .header-left {
      .header-title {
        margin: 0;
      display: flex;
      align-items: center;
      gap: 12px;
        color: #1a1a1a;
        font-weight: 600;

        .anticon {
          color: #1890ff;
          font-size: 24px;
      }

      .unread-badge {
        background: #ff4d4f;
        color: white;
          border-radius: 12px;
          padding: 4px 12px;
          font-size: 14px;
        font-weight: 500;
          margin-left: 12px;
        }
      }
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 12px;

      .new-conversation-btn {
        background: #1890ff;
        border: none;
          border-radius: 8px;
        height: 40px;
        padding: 0 20px;
          font-weight: 500;
          display: flex;
          align-items: center;
          gap: 8px;
        transition: all 0.2s ease;

          &:hover {
          background: #40a9ff;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
          }

        .anticon {
          font-size: 16px;
        }
      }

      .refresh-btn {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        border: 1px solid #d9d9d9;
        display: flex;
        align-items: center;
        justify-content: center;
        background: white;
          transition: all 0.2s ease;

          &:hover {
          border-color: #1890ff;
          color: #1890ff;
          transform: rotate(180deg);
        }

        .anticon {
          font-size: 16px;
            }
      }
            }
          }

  // 主要内容区域
  .message-content {
    flex: 1;
            display: flex;
    height: calc(100vh - 120px);

    // 对话列表
    .conversation-list {
      width: 360px;
      background: white;
      border-right: 1px solid #e9ecef;
      display: flex;
      flex-direction: column;

      .conversation-header {
        padding: 20px;
        border-bottom: 1px solid #e9ecef;

        .search-input {
          .ant-input {
            border-radius: 8px;
            border: 1px solid #d9d9d9;
            padding: 8px 12px;
              font-size: 14px;

            &:focus {
              border-color: #1890ff;
              box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
            }
          }
            }
          }

      .conversation-items {
        flex: 1;
        overflow-y: auto;

        .loading-container {
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          padding: 60px 20px;
            color: #666;

          .ant-spin {
            margin-bottom: 16px;
          }
        }

        .empty-container {
          display: flex;
          align-items: center;
          justify-content: center;
          height: 200px;
            color: #999;
        }

        // 对话项样式
        > div {
          &:hover {
            background: #f8f9fa;
          }

          &:active {
            background: #e9ecef;
          }
        }
      }
    }

    // 消息区域
    .message-area {
      flex: 1;
      display: flex;
      flex-direction: column;
      background: white;

      // 消息头部
      .message-header-bar {
        padding: 20px 24px;
        border-bottom: 1px solid #e9ecef;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #fafafa;

        .conversation-info {
          display: flex;
          align-items: center;
          gap: 12px;

          .conversation-details {
            .conversation-name {
              font-size: 16px;
              font-weight: 600;
              color: #1a1a1a;
              margin-bottom: 4px;
            }

            .conversation-status {
              font-size: 12px;
              color: #52c41a;
              display: flex;
              align-items: center;
              gap: 4px;

              &::before {
                content: '';
                width: 6px;
                height: 6px;
              background: #52c41a;
                border-radius: 50%;
              }
            }
          }
        }

        .conversation-actions {
          display: flex;
          gap: 8px;

          .action-btn {
            width: 36px;
            height: 36px;
            border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
            color: #666;
            transition: all 0.2s ease;

            &:hover {
              background: #f0f0f0;
              color: #1890ff;
        }
          }
        }
      }

      // 消息列表容器
      .messages-container {
        flex: 1;
        overflow-y: auto;
        padding: 20px 0;
        background: #f8f9fa;

        // 消息气泡样式
          .message-bubble {
            position: relative;
          max-width: 70%;
          word-wrap: break-word;
        }
      }

      // 回复区域
      .reply-area {
        padding: 12px 24px;
        background: #f0f8ff;
        border-top: 1px solid #e6f7ff;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .reply-content {
          flex: 1;

          .reply-label {
            font-size: 12px;
                color: #1890ff;
            font-weight: 500;
            margin-bottom: 4px;
              }

          .reply-text {
            font-size: 13px;
            color: #666;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
              }
            }

        .cancel-reply-btn {
          color: #999;
          padding: 4px;

          &:hover {
            color: #ff4d4f;
            }
          }
        }

      // 输入区域
      .message-input-area {
        padding: 20px 24px;
        border-top: 1px solid #e9ecef;
        background: white;

        .input-container {
          display: flex;
          gap: 12px;
          align-items: flex-end;

          .message-input {
            flex: 1;
            border-radius: 8px;
          border: 1px solid #d9d9d9;
            resize: none;
            font-size: 14px;
            line-height: 1.5;

            &:focus {
            border-color: #1890ff;
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
          }

            &::placeholder {
              color: #bfbfbf;
            }
          }

          .send-btn {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            background: #1890ff;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;

            &:hover:not(:disabled) {
              background: #40a9ff;
              transform: translateY(-1px);
            }

            &:disabled {
              background: #f5f5f5;
              color: #bfbfbf;
            }

            .anticon {
              font-size: 16px;
            }
            }
          }
        }

      // 无对话状态
      .no-conversation {
        flex: 1;
          display: flex;
          align-items: center;
        justify-content: center;
        background: #fafafa;

        .no-conversation-content {
          text-align: center;
          color: #666;

          .no-conversation-icon {
            font-size: 64px;
            color: #d9d9d9;
            margin-bottom: 24px;
          }

          h3 {
            color: #1a1a1a;
            margin-bottom: 12px;
          }

          .ant-typography {
            margin-bottom: 24px;
            color: #666;
          }

          .start-chat-btn {
            background: #1890ff;
            border: none;
            border-radius: 8px;
            height: 40px;
            padding: 0 24px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0 auto;
            transition: all 0.2s ease;

            &:hover {
              background: #40a9ff;
              transform: translateY(-1px);
              box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
            }
          }
        }
      }
    }
  }

  // AI助手浮动按钮
  .ai-assistant-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1000;

    .ai-fab-btn {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border: none;
      box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
      transition: all 0.3s ease;

      &:hover {
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
      }

      .anticon {
        font-size: 24px;
        color: white;
      }
    }
}

  // 模态框样式
  .profile-modal,
  .chat-modal,
  .history-modal {
  .ant-modal-content {
      border-radius: 12px;
    overflow: hidden;
  }

  .ant-modal-header {
      background: #fafafa;
      border-bottom: 1px solid #e9ecef;
    padding: 20px 24px;

    .ant-modal-title {
      font-weight: 600;
        color: #1a1a1a;
    }
  }

  .ant-modal-body {
      padding: 24px;
    }
  }

  // 聊天模态框内容
  .chat-modal-content {
    height: 600px;
    display: flex;
    flex-direction: column;

    .chat-messages-area {
      flex: 1;
      overflow-y: auto;
      background: #f8f9fa;
      border-radius: 8px;
        margin-bottom: 16px;

      .chat-messages {
        padding: 16px 0;
        min-height: 100%;
        }

      .no-messages {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: #999;
      }
    }

    .chat-input-area {
      border-top: 1px solid #e9ecef;
      padding-top: 16px;

      .input-container {
        display: flex;
        gap: 12px;
        align-items: flex-end;

        .chat-message-input {
          flex: 1;
          border-radius: 8px;
          border: 1px solid #d9d9d9;
          resize: none;
          font-size: 14px;
          line-height: 1.5;

          &:focus {
            border-color: #1890ff;
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
          }

          &::placeholder {
            color: #bfbfbf;
          }
        }

        .chat-send-btn {
          width: 40px;
          height: 40px;
          border-radius: 8px;
          background: #1890ff;
          border: none;
          display: flex;
          align-items: center;
          justify-content: center;
          transition: all 0.2s ease;

          &:hover:not(:disabled) {
            background: #40a9ff;
            transform: translateY(-1px);
          }

          &:disabled {
            background: #f5f5f5;
            color: #bfbfbf;
          }

          .anticon {
            font-size: 16px;
        }
      }
    }
  }
}

  // 历史记录模态框
  .history-content {
    .history-header {
      display: flex;
      align-items: center;
      gap: 16px;
      margin-bottom: 24px;
      padding-bottom: 16px;
      border-bottom: 1px solid #e9ecef;

      .history-info {
        h4 {
          margin: 0 0 4px 0;
          color: #1a1a1a;
          font-weight: 600;
}

        .ant-typography {
          color: #666;
          font-size: 13px;
        }
      }
    }

    .history-messages {
      max-height: 400px;
      overflow-y: auto;
      padding: 16px 0;
}
  }
}

// 新会话模态框样式
.new-conversation-modal {
  .ant-modal-body {
    padding: 0;
  }
}

.new-conversation-content {
  .contact-search {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    
    .contact-search-input {
      .ant-input {
        border-radius: 20px;
        padding-left: 16px;
        padding-right: 16px;
        height: 40px;
        border: 1px solid #d9d9d9;
    transition: all 0.3s ease;

        &:focus {
      border-color: #1890ff;
          box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
        }
      }
    }
  }
  
  .contacts-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
    
    .contact-item {
      display: flex;
      align-items: center;
      padding: 16px 24px;
      cursor: pointer;
      transition: all 0.2s ease;
      border-bottom: 1px solid #fafafa;
      
      &:hover {
        background-color: #f8f9ff;
    }

      &:last-child {
        border-bottom: none;
      }
      
      .contact-avatar {
        position: relative;
        margin-right: 16px;

        .online-indicator {
          position: absolute;
          bottom: 2px;
          right: 2px;
          width: 12px;
          height: 12px;
          border-radius: 50%;
          border: 2px solid white;
          
          &.online {
            background-color: #52c41a;
        }
          
          &.offline {
            background-color: #d9d9d9;
          }
        }
      }
      
      .contact-info {
        flex: 1;
        min-width: 0;
        
        .contact-name {
        display: flex;
        align-items: center;
        gap: 8px;
          margin-bottom: 4px;
          
          .ant-typography {
            margin: 0;
            font-size: 15px;
            font-weight: 500;
          }
          
          .ant-tag {
            margin: 0;
          font-size: 11px;
            padding: 2px 6px;
          border-radius: 10px;
        }
      }

        .contact-email {
          font-size: 12px;
          color: #999;
          margin: 0;
      }
    }

      .contact-action {
        margin-left: 16px;
        
      .ant-btn {
          border-radius: 16px;
          height: 32px;
          padding: 0 16px;
          font-size: 13px;
        font-weight: 500;
        }
      }
    }
  }
  
  .no-contacts {
    padding: 40px 24px;
    text-align: center;
    
    .ant-empty {
      .ant-empty-description {
        color: #999;
        font-size: 14px;
      }
    }
  }
}

// 响应式设计
@media (max-width: 768px) {
  .modern-message-center {
    .message-content {
      flex-direction: column;

      .conversation-list {
        width: 100%;
        height: 300px;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

      .message-area {
        height: calc(100vh - 420px);
    }
  }

    .ai-assistant-fab {
      bottom: 16px;
      right: 16px;

      .ai-fab-btn {
        width: 48px;
        height: 48px;

        .anticon {
          font-size: 20px;
    }
  }
  }
}

  .new-conversation-modal {
    .ant-modal {
      width: 90% !important;
      max-width: 500px;
    }
  }

  .new-conversation-content {
    .contact-item {
      padding: 12px 16px;
      
      .contact-avatar {
        margin-right: 12px;
        
        .ant-avatar {
          width: 40px !important;
          height: 40px !important;
  }
}

      .contact-info {
        .contact-name {
          .ant-typography {
            font-size: 14px;
    }
  }

        .contact-email {
    font-size: 11px;
        }
      }
      
      .contact-action {
        margin-left: 12px;
        
        .ant-btn {
          height: 28px;
          padding: 0 12px;
          font-size: 12px;
        }
      }
    }
  }
}

// 滚动条样式
.conversation-items,
.messages-container,
.history-messages {
  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;

    &:hover {
      background: #a8a8a8;
    }
  }
}

// 动画效果
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modern-message-center {
  animation: fadeIn 0.3s ease-out;
}

// 消息动画
.messages-container > div {
  animation: fadeIn 0.2s ease-out;
      }

// 对话项动画
.conversation-items > div {
  animation: fadeIn 0.15s ease-out;
}
